//
//  B_InteractMessageVC.m
//  DreamOf
//
//  Created by 薛小刚 on 2018/8/31.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import "B_InteractMessageVC.h"
#import "B_InteractMessageListTVC.h"




#import "B_UserMainPageVC.h"


#import "B_LeaveMessagesVC.h"

@interface B_InteractMessageVC ()
@property (nonatomic, strong) BaseView * mainView;

@end

@implementation B_InteractMessageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"消息"];
    self.view = self.mainView;
    
}

- (BaseView *)mainView {
    if (!_mainView) {
        WeakSelf(weSelf, self);
        _mainView = [[BaseView alloc] init];
        
        [_mainView setTableViewFrameWithTop:5 left:0 right:0 bottom:0];
        [_mainView.tableView registerNib:[UINib nibWithNibName:@"B_InteractMessageListTVC" bundle:nil] forCellReuseIdentifier:@"B_InteractMessageListTVC"];
        _mainView.numberOfRowsBlock = ^NSInteger(UITableView *tableView, NSInteger section) {
            return weSelf.dataArray.count + 2;
        };
       
        _mainView.cellForRowBlock = ^UITableViewCell *(UITableView *tableView, NSIndexPath *indexPath) {
            B_InteractMessageListTVC * cell = [tableView dequeueReusableCellWithIdentifier:@"B_InteractMessageListTVC" forIndexPath:indexPath];
            cell.B_imageView.backgroundColor = [UIColor redColor];
            cell.B_useImageView.backgroundColor = [UIColor orangeColor];
            cell.B_titleLabel.text = @"巧克力松饼";
            cell.B_timeLabel.text = @"2018-02-08";
            if (indexPath.row % 2 == 0) {
                cell.B_contentLabel.text = @"赞了你的话题";
                cell.B_thirdLabel.hidden = YES;
            } else {
                cell.B_contentLabel.text = @"你养的多肉好可爱啊阿拉克丝的减肥了卡加上地方离开静安寺浪蝶狂蜂骄傲了款式大方绿卡交的首付了空间啊落实到付款";
                cell.B_thirdLabel.hidden = NO;
                cell.B_thirdLabel.text = @"评论了你的话题";
            }
            return cell;
        };
        _mainView.didSelectRow = ^(UITableView *tableView, NSIndexPath *indexPath) {
            
            B_UserMainPageVC * userMain = [[B_UserMainPageVC alloc] init];
            
            [weSelf pushNextViewController:userMain];
//            B_LeaveMessagesVC * test = [[B_LeaveMessagesVC alloc] init];
//
//            [weSelf pushNextViewController:test];
        };
        
    }
    return _mainView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
